const app = getApp()
Page({
    data: {
        url: ''
    },
    onLoad(option) {
        console.log(option)
        wx.showLoading({
            title: '页面加载中...',
        })

        let url = `https://mobile.1safety.cc/safetytrain/index.html?ticket=${option.ticket}`
        let wxTime = new Date().getTime()
        url = `${url}&wxTime=${wxTime}`
        this.setData({
            url: url
        })
        setTimeout(() => {
            wx.hideLoading()
        }, 2000)
    },
    // h5PostMessage: function(e) {
    //     console.log(e.detail.data)
    //     this.h5Data = e.detail.data[e.detail.data.length - 1]; //当用户点击这个h5页面的分享时获取到
    // },

    // 用户点击右上角分享
    // onShareAppMessage: function(options) {
    //     return {
    //         title: this.h5Data.title,
    //         desc: this.h5Data.desc,
    //         path: this.h5Data.path
    //     }
    // },
    h5Load: function() {
        // wx.hideLoading()
    },
    h5LoadError: function(e) {
        // wx.hideLoading()
        wx.showToast({
            title: e.detail,
            duration: 2000
        })
    }
})